package com.atguigu11.annotation;

import java.util.Date;

/**
 * ClassName: AnnotationTest
 * Package: com.atguigu11.annotation
 * Description:
 *
 * @Author ZY
 * @Create 22:06
 * @Version 1.0
 */
public class AnnotationTest {
    public static void main(String[] args) {

        Person person = new Student();
        person.eat();


        Date date = new Date();
        System.out.println(date);

//        Date date1 = new Date(2022,11,29);
//        System.out.println(date1);

        Person p2 = new Person();
        Person p3 = new Person("Tom");
        System.out.println(p3);

        @SuppressWarnings("unused") int num = 10;
    }

}


@MyAnnotation(value = "class")
class Person{
    String name;
    int age;

    @MyAnnotation()
    public Person(){}

    public void eat(){
        System.out.println("人吃饭");
    }

    @Deprecated
    public Person(String name){
        this.name = name;
    }
}

class Student extends Person{
    @Override
    public void eat(){
        System.out.println("学生吃饭");
    }
}

